<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('彩票支付订单列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 120px;">购彩商户编号：</label>
                                <input type="text" name="merno"/>
                            </li>
                            <li>
                                <label style="width: 120px;">购彩商户名称：</label>
                                <input type="text" name="mer_name"/>
                            </li>
                            <li>
                                <label style="width: 120px;">收单商户编号：</label>
                                <input type="text" name="mer_no"/>
                            </li>
                            <li>
                                <label style="width: 120px;">收单商户名称：</label>
                                <input type="text" name="mername"/>
                            </li>
                            <li>
                                <label style="width: 120px;">订单交易状态:</label>
                                <select name="status">
                                    <option value="">请选择</option>
                                    <option value="0">交易成功</option>
                                    <option value="1">待支付</option>
                                    <option value="2">交易失败</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 120px;">资金状态:</label>
                                <select name="au_state">
                                    <option value="">请选择</option>
                                    <option value="0">未清算</option>
                                    <option value="1">已清算</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label style="width: 120px;">下单日期：</label>
                                <input type="text" name="localdate1" id="startTime" class="time-input" />
                                <span>-</span>
                                <input type="text" name="localdate2" id="endTime" class="time-input"/>
                            </li>
                            <li class="select-time">
                                <label style="width: 120px;">支付日期：</label>
                                <input type="text" name="localdate3"  class="time-input" />
                                <span>-</span>
                                <input type="text" name="localdate4"  class="time-input"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

           <!-- <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="lotteryPaymentOrder:lotteryPaymentOrder:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('lotteryPaymentOrder:lotteryPaymentOrder:edit')}]];
        var removeFlag = [[${@permission.hasPermi('lotteryPaymentOrder:lotteryPaymentOrder:remove')}]];
        var prefix = ctx + "lotteryPaymentOrder/lotteryPaymentOrder";

        $(function() {
            var options = {
                url: prefix + "/list2",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "彩票支付订单",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'MERNO',
                    title: '购彩商户编号',
                },
                {
                    field: 'MERNAME',
                    title: '购彩商户名称'
                },
                {
                    field: 'LINK_PHONE',
                    title: '购彩手机号'
                },
                {
                    field: 'MER_NO',
                    title: '收单商户编号'
                },
                {
                    field: 'MER_NAME',
                    title: '收单商户名称'
                },
                {
                    field: 'SERIAL',
                    title: '订单编号'
                },
                {
                    field: 'AMOUNT',
                    title: '订单交易金额',
                    formatter: function (value, row, index) {
                        return $.table.rmbFormatter(value);
                    }

                },
                {
                    field: 'STATUS',
                    title: '订单交易状态',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "<span style='color: green'>交易成功</span>";
                        } else if (value == '1'){
                            return "<span style='color: blue'>待支付</span>";
                        } else if (value == '2'){
                            return "<span style='color: red'>交易失败</span>";
                        } else {
                            return "<span>未知</span>";
                        }
                    }
                },
                {
                    field: 'LOCAL_DATE',
                    title: '订单下单时间'
                },
                {
                    field: 'TRANS_OVER_TIME',
                    title: '交付截止时间'
                },
                {
                    field: 'TRANS_DATE',
                    title: '订单支付时间'
                },
                {
                    field: 'TERNO',
                    title: '支付终端号'
                },
                {
                    field: 'TRANS_SERIAL',
                    title: '支付流水号'
                },
                {
                    field: 'TRADE_CHARGES',
                    title: '手续费',
                    formatter: function (value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'AU_STATE',
                    title: '订单交易状态',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "<span style='color: red'>未清算</span>";
                        } else if (value == '1'){
                            return "<span style='color: green'>已清算</span>";
                        } else {
                            return "<span>未知</span>";
                        }
                    }
                },]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>